/*************************************************************************
	> File Name: EP12-1.cpp
	> Author: 
	> Mail: 
	> Created Time: 
 ************************************************************************/
#include <stdio.h>
#include <math.h>

long long triangle(int n) {
    return (1 + n) * n / 2;
}

int get_factor(long long n) {
    int cnt = 0, I = sqrt(n);
    for (int i = 1; i <= I; i++) {
        if (n % i == 0) cnt += 2;
    }
    if (I * I == n) cnt -= 1;
    return cnt;
}

int main() {
    int n = 29, flag = 1;
    while (flag) {
        n++;
        long long val = triangle(n);
        if (get_factor(val) <= 500) continue;
        flag = 0;
        printf("%lld\n", val);
    }
    return 0;
}
